home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
boosters.arc
/
UPPER.ASM
< prev
next >
Wrap
Assembly Source File
|
1985-11-09
|
896b
|
45 lines
;******************************************
;
; Function Upper ( S : AnyString)
; : AnyString;
;
; Converts alphabetics to uppercase.
;******************************************
UPPER proc near
push bp
mov bp,sp
push ds
;
;*** Fetch S and check for null length
;
mov cl,[bp+4] ; length of S
xor ch,ch
lea si,[bp+5] ; 1st source byte
lea di,[bp+260] ; length of RESULT
mov ss:[di],cl ; set length
cmp cl,0 ; check for null
jbe stop
;
;*** Set up pointers to S and Result string
;
inc di
mov ax,ss
mov ds,ax
mov es,ax
cld ; set direct fwd
u001: mov al,[si]
cmp al,97 ; 'a'?. . .
jb u002 ; below
cmp al,122 ; 'z'?. . .
ja u002 ; above
sub al,32 ; UPPER-CASE IT
u002: stosb ; store in result
inc si
loop u001 ; loop till cx=0
;
STOP: pop ds
mov sp,bp
pop bp
ret 256
UPPER endp